package com.tarry.chain;

import lombok.extern.slf4j.Slf4j;

import java.util.Objects;

@Slf4j
public class GeneralManager extends Manager{

    public GeneralManager(String name) {
        super.name = name;
    }

    @Override
    void handle(Request request) {
        if (Objects.equals("请假", request.getRequestType())) {
            log.info("{} : {} 数量：{} 审批通过", name, request.getRequestContent(), request.getNumber());
        }else if (Objects.equals("加薪", request.getRequestType()) && request.getNumber() < 1000) {
            log.info("{} : {} 数量：{} 审批通过", name, request.getRequestContent(), request.getNumber());
        }else  if (Objects.equals("加薪", request.getRequestType()) && request.getNumber() >= 1000) {
            log.info("{} : {} 数量：{} 难度太大~~~", name, request.getRequestContent(), request.getNumber());
        }
    }
}
